/** 登录 */
// const request = require("../../utils/request")

function mockFetchHome() {
  const { delay } = require('../_utils/delay');
  const { genSwiperImageList } = require('../../model/swiper');
  return delay().then(() => {
    return {
      swiper: genSwiperImageList(),
      tabList: [
        {
          text: '精选推荐',
          key: 0,
        },
        {
          text: '室内',
          key: 1,
        },
        {
          text: '室外',
          key: 2,
        },
        {
          text: '防盗门',
          key: 3,
        },
        {
          text: '玻璃门',
          key: 4,
        },
        {
          text: '木门',
          key: 5,
        },
        {
          text: '门锁',
          key: 6,
        },
      ],
      activityImg: `${cdnBase}/activity/banner.png`,
    };
  });
}

/** 获取首页数据 */
export function login(param) {
  if (config.useMock) {
    return mockFetchHome();
  }
  return new Promise((resolve) => {
    resolve('real api');
  });
  // const url = "";
  // const method = "POST"
  // return request(url, param, method)
  //   .then(res => {
  //     console.log('login result: ', res)
  //     if (res.code == '200') {

  //     }
  //   });
}
